package day1118;

import java.util.Scanner;

public class SwitchDemo {
    public static void main(String[] args) {
        String  pwd="";
        Scanner  sc=new Scanner(System.in);
        System.out.println("请输入您要进行的操作('a'-安放炸弹，'c'-拆除)");
        char  cmd=0 ;
        while( 1<2 ){
            cmd=(char)sc.nextInt();
            switch (cmd){
                case 'a':
                    System.out.println("安放炸弹");
                    System.out.println("请输入您要设置的密码：");
                    pwd=sc.next();
                    break;
                case 'c':
                    System.out.println("拆除");
                    String pwd2=sc.next();
                    if(pwd.equals(pwd2)){
                        System.out.println("拆除成功");
                        return;//结束main方法
                    }else{
                        System.out.println("拆除失败");
                    }
                    break;
                default:
                    System.out.println("打印正在计时");
            }
        }

    }
}
